package com.example.springbootdemo;

import org.springframework.beans.factory.BeanNameAware;
import org.springframework.stereotype.Component;

/**
 * 自定义BeanNameAware
 */
@Component(value = "testBeanName")
public class MyBeanName implements BeanNameAware {
    @Override
    public void setBeanName(String name) {
        System.out.println("BeanNameAware的setBeanName："+name);
    }
}